/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CreateTable;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import oracle.jdbc.pool.OracleDataSource;

/**
 *
 * @author YosephDewa
 */
public class InsertUserGudang {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        String jdbcUrl = "jdbc:oracle:thin:@localhost:1521:XE";
        String userid = "hr"; // gantikan dengan username anda
        String password = "hr"; // gantikan dengan password anda
        try {
            Connection connection = null;
            OracleDataSource ds;
            ds = new OracleDataSource();
            ds.setURL(jdbcUrl);
            ds.setPassword(password);
            ds.setUser(userid);
            connection = (Connection) ds.getConnection();
            Statement statement = connection.createStatement();
            statement.executeQuery("insert into usergaselpiji values ('dio','dio','sleman','087444555333','admin','dio')");
            statement.executeQuery("insert into usergaselpiji values ('alfon','alfon','temanggung','087666555444','pengecer','alfon')");
            statement.executeQuery("insert into usergaselpiji values ('tungki','tungki','jogja','088555444333','admin','tungki')");
            statement.executeQuery("insert into usergaselpiji values ('bagus','bagus','batang','089777000555','pengecer','bagus')");
            } catch (SQLException e) {
// perform error handling here
            System.out.println("error :" + e.getMessage());
        }
    }
}
